package com.qianguo.shop.activity;

import com.eva.androidlibrary.utils.SharedPreferencesHelper;
import com.qianguo.shop.R;
import com.qianguo.shop.base.BaseNoTitleActivity;
import com.qianguo.shop.constant.SpKeys;

import org.androidannotations.annotations.EActivity;
import org.androidannotations.annotations.Fullscreen;

/**
 * 商家欢迎页面
 *
 * @author GUXIA318
 * @date 2015-09-21 14:56
 */
@Fullscreen
@EActivity(R.layout.activity_welcome)
public class WelcomeActivity extends BaseNoTitleActivity {

    @Override
    protected void initializeUI() {
        // 判断是否第一次进入app
        // 是则进入引导页面
        // 否则进入首页
        if (SharedPreferencesHelper.getInstance(this).getBoolean(SpKeys.IS_FIRST_LAUNCH, true)) {
            GuideActivity.jumpToGuide(this);
        } else if (mApp.isLogin()) {
            ShopMainActivity.jumpToMain(this);
        } else {
            LoginActivity.jumpToLogin(this);
        }
        finish();
    }

}
